import request from '@/utils/request'


//新增规则

export function addrule(data) {
  return request({
    url: '/joint/rule/create',
    method: 'post',
    data,
  })
}

//列表
export function getruleList(data) {
  return request({
    url: '/joint/rule',
    method: 'get',
    params: data,
  })
}

//删除
export function delitem(data) {
  return request({
    url: '/joint/rule/delete',
    method: 'delete',
    data
  })
}

//获取详情
export function getDetail(data) {
  return request({
    url: '/joint/rule/read',
    method: 'get',
    params: data,
  })
}

//修改数据
export function updatarule(data) {
  return request({
    url: '/joint/rule/update',
    method: 'put',
    data
  })
}
//角色列表
export function accountRole(data) {
  return request({
    url: '/account/role',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true
    }
  })
}
//角色创建
export function accountRoleCreate(data) {
  return request({
    url: '/account/role/create',
    method: 'post',
    data,
    headers: {
      'showLoading': false
    }
  })
}
//角色编辑
export function accountRoleUpdate(data) {
  return request({
    url: '/account/role/update',
    method: 'put',
    data,
    headers: {
      'showLoading': false
    }
  })
}

//角色详情
export function accountRoleRead(data) {
  return request({
    url: '/account/role/read',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}

//角色状态切换
export function accountRoleUpdatestatus(data) {
  return request({
    url: '/account/role/updatestatus',
    method: 'put',
    data,
    headers: {
      'showLoading': false
    }
  })
}
//角色删除
export function accountRoleDelete(data) {
  return request({
    url: '/account/role/delete',
    method: 'delete',
    data,
    headers: {
      'showLoading': false
    }
  })
}

//权限树
export function accountRuleTree(data) {
  return request({
    url: '/account/rule/tree',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
    'loadingTarget':'.innerloding'
    }
  })
}
//设置权限
export function accountRoleSetting(data) {
  return request({
    url: '/account/role/setting',
    method: 'put',
   data,
    headers: {
      'showLoading': false,
    }
  })
}

//设置权限(机构)
export function schoolTeamSetting(data) {
  return request({
    url: '/school/team/setting',
    method: 'put',
   data,
    headers: {
      'showLoading': false,
    }
  })
}

//员工列表
export function accountList(data) {
  return request({
    url: '/account',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true,
    }
  })
}
//员工列表删除
export function accountDelete(data) {
  return request({
    url: '/account/delete',
    method: 'delete',
    data,
    headers: {
      'showLoading': false,
    }
  })
}
//员工状态切换
export function acountUpdateStatus(data) {
  return request({
    url: '/account/updateStatus',
    method: 'put',
    data,
    headers: {
      'showLoading': false,
    }
  })
}
//员工编辑
export function accountUpdate(data) {
  return request({
    url: '/account/update',
    method: 'put',
    data,
    headers: {
      'showLoading': false,
    }
  })
}
//员工新增
export function accountCreate(data) {
  return request({
    url: '/account/create',
    method: 'post',
    data,
    headers: {
      'showLoading': false,
    }
  })
}
//员工详情
export function accountRead(data) {
  return request({
    url: '/account/read',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false,
    }
  })
}
//角色选项
export function accountRoleOption(data) {
  return request({
    url: '/account/role/option',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false,
    }
  })
}
